from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.
# class User(AbstractUser):
#     username = models.CharField(max_length=64, unique=True, error_messages={
#             'max_length':u'账号不能超过64位',
#             'unique':u'账号已注册'
#         })
#     password = models.CharField(max_length=255)
#     email    = models.EmailField()
#     create_at = models.DateTimeField(auto_now_add=True)
#     update_at = models.DateTimeField(auto_now=True)

class Article(models.Model):
    title = models.CharField(max_length=64,verbose_name='文章标题')
    content = models.TextField(verbose_name='文章内容')
    cid = models.IntegerField(verbose_name='分类ID')
    img = models.CharField(max_length=255,verbose_name='文章图片')
    create_at = models.DateTimeField(auto_now_add=True)
    update_at = models.DateTimeField(auto_now=True)

class Cates(models.Model):
    name = models.CharField(max_length=64,verbose_name='分类名称')
    create_at = models.DateTimeField(auto_now_add=True)
    update_at = models.DateTimeField(auto_now=True)
